import request from '@/utils/request'

// 查询更新日志列表
export function listUpdateLogs(query) {
  return request({
    url: '/pond/app/admin/update-logs',
    method: 'get',
    params: query
  })
}

// 查询更新日志详细
export function getUpdateLog(id) {
  return request({
    url: '/pond/app/admin/update-logs/' + id,
    method: 'get'
  })
}

// 删除更新日志
export function delUpdateLog(id) {
  return request({
    url: '/pond/app/admin/update-logs/' + id,
    method: 'delete'
  })
}

// 导出更新日志
export function exportUpdateLogs(query) {
  return request({
    url: '/pond/app/admin/update-logs/export',
    method: 'get',
    params: query
  })
}

// 获取设备更新轨迹
export function getDeviceUpdateHistory(deviceId) {
  return request({
    url: '/pond/app/admin/device/' + deviceId + '/update-history',
    method: 'get'
  })
}

// 兼容旧函数名
export function getDeviceUpdateTrack(deviceId) {
  return getDeviceUpdateHistory(deviceId);
}